package bootstrap

import (
	"fmt"
	"go-mall/global"
)

type server interface {
	ListenAndServe() error
}

// RunServer 启动服务
func RunServer() {
	if global.CONFIG.System.UseMultipoint || global.CONFIG.System.UseRedis {
		// 初始化redis服务
		Redis()
		fmt.Println("初始化redis服务")
	}
	address := ":3000"
	Router := CreateRouter()
	s := httpServer(address, Router)
	fmt.Println("启动服务", "http://127.0.0.1"+address)
	global.LOG.Error(s.ListenAndServe().Error())

}
